//
//  CTPFlickrFirstFetcher.m
//  citipad
//
//  Created by Chih Yuan Liu on 3/11/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CTPFlickrFirstFetcher.h"


@implementation CTPFlickrFirstFetcher

@synthesize delegate;

- (void)requestSucceeded {
	[delegate flickrFirstFetcherSucceeded: self data:recievedData];
	[delegate flickrFirstFetcherEnd:self];
}

-(void)requestFailed:(NSError*)error {
	[delegate flickrFirstFetcherFailed:self];
	[delegate flickrFirstFetcherEnd:self];
}

-(NSString*) URLForCtpProxy:(NSString*) tags{
	NSString* url = [NSString stringWithFormat:
					 @"http://114.34.48.246/CtpSvr/svr.ashx?method=flickrfirst&key=%@", 
					 tags];
	return url;
}

-(void)getDataFromCtp:(NSString*) tags{
	NSString* url = [self URLForCtpProxy:tags];
	NSLog(@"%@", url);
	[super requestGET:url];
	[delegate flickrFirstFetcherBegin:self];
}




@end
